package com.tjrac.generalpermissions.domain;

/**
 * 用户实体类
 *
 * @author ZeNing
 * @create 2020-11-22 15:41
 */
public class User {

    private Integer id;         //用户id 主键 自增
    private String username;    //用户登陆账号 非空
    private String password;    //用户登录口令 非空
    private Role role;          //用户被授予的角色

    public User() {
    }

    public User(Integer id) {
        this.id = id;
    }

    public User(String username, String password, Role role) {
        this.username = username;
        this.password = password;
        this.role = role;
    }

    public User(Integer id, String username, String password, Role role) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.role = role;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", role=" + role +
                '}';
    }
}
